unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, DB, StdCtrls, DBClient;

type
  TFormMain = class(TForm)
    Button1: TButton;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    EditKS: TEdit;
    Label1: TLabel;
    Button2: TButton;
    ClientDataSet1: TClientDataSet;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormMain: TFormMain;

implementation
uses BF_Data,pub_Data,Pub_DataHisZY;
{$R *.dfm}

procedure TFormMain.FormCreate(Sender: TObject);
begin
  PubDataManager.CreatePubData(TPubDataHisZY, TPubData(PubDataHisZY));
  BFData := TBFData.Create(Self);
end;

procedure TFormMain.FormDestroy(Sender: TObject);
begin
  BFData.Free;
  PubDataManager.FreePubData(TPubData(PubDataHisZY));
end;

procedure TFormMain.Button1Click(Sender: TObject);
begin
  BFData.OpenZYBH;
  ClientDataSet1.Data := BFData.DataSetZYBH.Data;
end;

procedure TFormMain.Button2Click(Sender: TObject);
begin
  PubDataHisZY.LoginEnvt.GV_BelongUnit := EditKS.Text;
  PubDataHisZY.LoginEnvt.GV_KSList := '';
  PubDataHisZY.ZYPubProc.InitGlobalValue;
end;

end.
